package com.qfedu.fmmall.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qfedu.fmmall.entity.UserAddr;
import com.qfedu.fmmall.mapper.UserAddrMapper;
import com.qfedu.fmmall.service.UserAddrService;
import com.qfedu.fmmall.vo.ResultVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用户地址  服务实现类
 * </p>
 *
 * @author itcast
 */
@Slf4j
@Service
public class UserAddrServiceImpl extends ServiceImpl<UserAddrMapper, UserAddr> implements UserAddrService {
    @Autowired
    private UserAddrMapper userAddrMapper;
    /**
     *
     *   查询用户收货地址接口
     * @param userId
     * @return
     */
    @Override
    public ResultVO selectList(Integer userId) {
        List<UserAddr> list = userAddrMapper.selectList(new LambdaQueryWrapper<UserAddr>().eq(UserAddr::getUserId,userId ));
        return ResultVO.success(list,"200");
    }
}
